package com.geekhalo.admin.app.app;

import com.geekhalo.admin.domain.app.create.CreateWebApplicationCommand;
import com.geekhalo.admin.domain.app.create.CreateWebApplicationContext;
import com.geekhalo.admin.domain.app.disable.DisableWebApplicationCommand;
import com.geekhalo.admin.domain.app.disable.DisableWebApplicationContext;
import com.geekhalo.admin.domain.app.enable.EnableWebApplicationCommand;
import com.geekhalo.admin.domain.app.enable.EnableWebApplicationContext;
import com.geekhalo.admin.domain.app.update.UpdateWebApplicationCommand;
import com.geekhalo.admin.domain.app.update.UpdateWebApplicationContext;
import com.geekhalo.lego.core.command.CommandApplicationServiceDefinition;
import com.geekhalo.lego.core.command.CommandMethodDefinition;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import com.geekhalo.admin.domain.app.WebApplicationCommandRepository;
import com.geekhalo.admin.domain.app.WebApplication;

@CommandApplicationServiceDefinition(
        domainClass = WebApplication.class,
        repositoryClass = WebApplicationCommandRepository.class
)
@Validated
public interface WebApplicationCommandApplication {

    @CommandMethodDefinition(contextClass = CreateWebApplicationContext.class)
    WebApplication create(@Valid CreateWebApplicationCommand command);

    @CommandMethodDefinition(contextClass = UpdateWebApplicationContext.class)
    void update(@Valid UpdateWebApplicationCommand command);

    @CommandMethodDefinition(contextClass = EnableWebApplicationContext.class)
    void enable(@Valid EnableWebApplicationCommand command);

    @CommandMethodDefinition(contextClass = DisableWebApplicationContext.class)
    void disable(@Valid DisableWebApplicationCommand command);
}
